﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace M3U8下载神器
{
    public class XQueue<T>:Queue<T>
    {
        public XQueue() : base() { }
        public XQueue(int capacity) : base(capacity) { }
        public XQueue(IEnumerable<T> collection) : base(collection) { }
        public void Enqueue(IEnumerable<T> collection)
        {
            foreach(T t in collection)
            {
                Enqueue(t);
            }
        }
        public T TryDequeue()
        {
            try
            {
                return Dequeue();
            }
            catch (InvalidOperationException)
            {
                return default;
            }
        }
    }
}
